package com.zzedu.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zzedu.common.annotation.Excel;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 班级管理对象 zz_classes
 *
 * @author Mr.Wang
 * @date 2025-01-29
 */
@TableName("zz_classes")
public class ZzClasses implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 班级名称
     */
    @Excel(name = "班级名称")
    @NotBlank(message = "班级名称不能为空")
    private String name;

    /**
     * 校区ID
     */
    @Excel(name = "校区ID")
    private Long schoolId;

    /**
     * 正常
     */
    @Excel(name = "正常")
    @NotNull(message = "正常不能为空")
    private Integer state;

    /**
     * 添加时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime gmtModify;

    /**
     * 逻辑删除(0：未删除 1：id)
     */
    @TableLogic(delval = "id")
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;

    @TableField(fill = FieldFill.INSERT)
    private Long createBy;
    @TableField(fill = FieldFill.UPDATE)
    private Long updateBy;


    /**
     * 级别
     */
    private String level;

    /**
     * 班级类型 1-常规班 2-特殊班
     */
    private Integer clzzType;

    /**
     * 上课频率 clzz_type=1 有值
     */
    private Integer frequency;
    /**
     * 对应课程 clzzType=2 最多2个unit
     */
    private String unitIds;

    /**
     * 班主任ID
     */
    private Long teacherId;
    /**
     * 课表类型 1-周期(clzz_type=1) 2-自定义(clzz_type=2)
     */
    private Integer timetableType;
    /**
     * 开课日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate openDate;

    /**
     * 上课时间 JSON
     * [
     * {
     * "day":1, // 1-7 周一到周日
     * "dayText":"", //星期几
     * "startTime":"08:00", //开始时间
     * "endTime":"12:00" //结束时间
     * }...
     * ]
     */
    private String cycleStudyDate;
    /**
     * 教室
     */
    private String roomName;

    /**
     * 任课老师
     */
    private String remarkTeachName;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(Long schoolId) {
        this.schoolId = schoolId;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public LocalDateTime getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(LocalDateTime gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public LocalDateTime getGmtModify() {
        return gmtModify;
    }

    public void setGmtModify(LocalDateTime gmtModify) {
        this.gmtModify = gmtModify;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public Long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public Long getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(Long updateBy) {
        this.updateBy = updateBy;
    }

    public String getUnitIds() {
        return unitIds;
    }

    public void setUnitIds(String unitIds) {
        this.unitIds = unitIds;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public Long getTeacherId() {
        return teacherId;
    }

    public void setTeacherId(Long teacherId) {
        this.teacherId = teacherId;
    }

    public Integer getTimetableType() {
        return timetableType;
    }

    public void setTimetableType(Integer timetableType) {
        this.timetableType = timetableType;
    }

    public LocalDate getOpenDate() {
        return openDate;
    }

    public void setOpenDate(LocalDate openDate) {
        this.openDate = openDate;
    }

    public String getCycleStudyDate() {
        return cycleStudyDate;
    }

    public void setCycleStudyDate(String cycleStudyDate) {
        this.cycleStudyDate = cycleStudyDate;
    }

    public String getRoomName() {
        return roomName;
    }

    public void setRoomName(String roomName) {
        this.roomName = roomName;
    }

    public Integer getClzzType() {
        return clzzType;
    }

    public void setClzzType(Integer clzzType) {
        this.clzzType = clzzType;
    }

    public Integer getFrequency() {
        return frequency;
    }

    public void setFrequency(Integer frequency) {
        this.frequency = frequency;
    }

    public String getRemarkTeachName() {
        return remarkTeachName;
    }

    public void setRemarkTeachName(String remarkTeachName) {
        this.remarkTeachName = remarkTeachName;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
    }
}
